<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件使用的细节</title>
    <script src="./vue.js"></script>
</head>
<body>
<div id="app">
    <table>
        <tbody>
        <tr is="row"></tr>
        <tr is="row"></tr>
        <tr is="row"></tr>
        </tbody>
    </table>
</div>
<script>
    Vue.component('row', {
        // 错误写法
        // data: {
        //     content: "this is a row"
        // },
        //正确写法
        data: function () {
            return {
                content: 'this is row'
            }
        },
        template: '<tr><td>{{content}}</td></tr>'
    });
    var app = new Vue({
        el: '#app'
    });
</script>
</body>
</html>